//导入创建路由器的方法
import { createRouter, createWebHistory } from 'vue-router'
//导入对应要跳转的组件
import AdminLogin from '@/views/login/AdminLogin.vue';
import UserLogin from '@/views/login/UserLogin.vue';
import LoginVue from '@/views/login/Login.vue'
import EmpMessage from '@/views/admin/system/admin/emp/EmpMessage.vue';
import Menu from '@/views/admin/system/admin/menu/Menu.vue';
import HomeMessage from '@/views/admin/system/HomeMessage.vue';
import EmpAttendance from '@/views/admin/system/admin/emp/EmpAttendance.vue';
import EmpLeave from '@/views/admin/system/admin/emp/EmpLeave.vue';
import EmpResign from '@/views/admin/system/admin/emp/EmpResign.vue';
import Training from '@/views/admin/activity/training/Training.vue';
import TeamBuilding from '@/views/admin/activity/team-building/TeamBuilding.vue';
import UserHome from '@/views/user/system/UserHome.vue';
import MenuIndex from '@/views/user/system/user/menu/MenuIndex.vue';
import UserCenter from '@/views/user/system/user/emp/personcenter/index.vue'
import UserAttend from '@/views/user/system/user/emp/attendance/index.vue'
import UserLeave from '@/views/user/system/user/emp/leave/index.vue'
import UserResign from '@/views/user/system/user/emp/resign/index.vue'
import UserTraining from '@/views/user/activity/Training.vue'
import UserTeamBuilding from '@/views/user/activity/TeamBuilding.vue'
import UserMessage from "@/views/user/system/message/index.vue"
import NoRights from '@/views/admin/log/adminlogmanaegment/norights/index.vue'
import AdminLogManager from '@/views/admin/log/adminlogmanaegment/index.vue'
import EmpLogManager from '@/views/admin/log/emplogmanagement/index.vue'
//创建route数组
const routes = [
    {
        path: '/adminLogin',
        component: AdminLogin
    },
    {
        path: '/userLogin',
        component: UserLogin
    },
    {
        path: '/',
        component: LoginVue
    },
    {
        path: '/adminHome',
        component: HomeMessage,
        children: [
            {
                path: '/menu',
                component: Menu,
                children: [
                    {
                        path: 'empMessage',
                        component: EmpMessage
                    },
                    {
                        path: 'empAttendance',
                        component: EmpAttendance
                    },
                    {
                        path: 'empLeave',
                        component: EmpLeave
                    },
                    {
                        path: 'empResign',
                        component: EmpResign
                    },
                    {
                        path: 'training',
                        component: Training
                    },
                    {
                        path: 'teamBuilding',
                        component: TeamBuilding
                    },
                    {
                        path: 'noRights',
                        component: NoRights
                    },
                    {
                        path:'adminLogManager',
                        component: AdminLogManager
                    },
                    {
                        path:'empLogManager',
                        component: EmpLogManager
                    }
                ]
            },
        ]
    },
    {
        path: '/userHome',
        component: UserHome,
        children: [
            {
                path: '/userMenu',
                component: MenuIndex,
                children:[
                    {
                        path:'userMessage',
                        component: UserCenter
                    },
                    {
                        path:'userAttend',
                        component:UserAttend
                    },
                    {
                        path:'userLeave',
                        component:UserLeave
                    },
                    {
                        path:'userResign',
                        component:UserResign
                    },
                    {
                        path:'userTraining',
                        component:UserTraining
                    },
                    {
                        path:'userTeamBuilding',
                        component:UserTeamBuilding
                    },
                ]
            },
            {
                path:'userChat',
                component:UserMessage
            }
        ]
    }
]
//创建路由器连接
const router = createRouter({
    history: createWebHistory(),
    routes
});
//把路由器交出去
export default router



